package com.rongshu.view.userInfo.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

public class Province implements Parcelable{


    /**
     * ErrCode : 0
     * ErrMsg :
     * Response : [{"id":1770,"title":"北京市","sort_id":99},{"id":1771,"title":"天津市","sort_id":99},{"id":1772,"title":"河北省","sort_id":99},{"id":1773,"title":"山西省","sort_id":99},{"id":1774,"title":"内蒙古自治区","sort_id":99},{"id":1775,"title":"辽宁省","sort_id":99},{"id":1776,"title":"吉林省","sort_id":99},{"id":1777,"title":"黑龙江省","sort_id":99},{"id":1778,"title":"上海市","sort_id":99},{"id":1779,"title":"江苏省","sort_id":99},{"id":1780,"title":"浙江省","sort_id":99},{"id":1781,"title":"安徽省","sort_id":99},{"id":1782,"title":"福建省","sort_id":99},{"id":1783,"title":"江西省","sort_id":99},{"id":1784,"title":"山东省","sort_id":99},{"id":1785,"title":"河南省","sort_id":99},{"id":1786,"title":"湖北省","sort_id":99},{"id":1787,"title":"湖南省","sort_id":99},{"id":1788,"title":"广东省","sort_id":99},{"id":1789,"title":"海南省","sort_id":99},{"id":1790,"title":"广西壮族自治区","sort_id":99},{"id":1791,"title":"甘肃省","sort_id":99},{"id":1792,"title":"陕西省","sort_id":99},{"id":1793,"title":"新疆维吾尔自治区","sort_id":99},{"id":1794,"title":"青海省","sort_id":99},{"id":1795,"title":"宁夏回族自治区","sort_id":99},{"id":1796,"title":"重庆市","sort_id":99},{"id":1797,"title":"四川省","sort_id":99},{"id":1798,"title":"贵州省","sort_id":99},{"id":1799,"title":"云南省","sort_id":99},{"id":1800,"title":"西藏自治区","sort_id":99},{"id":1801,"title":"台湾省","sort_id":99},{"id":1802,"title":"澳门特别行政区","sort_id":99},{"id":1803,"title":"香港特别行政区","sort_id":99}]
     */

    private int ErrCode;
    private String ErrMsg;
    private List<ResponseBean> Response;

    protected Province(Parcel in) {
        ErrCode = in.readInt();
        ErrMsg = in.readString();
        Response = in.createTypedArrayList(ResponseBean.CREATOR);
    }

    public static final Creator<Province> CREATOR = new Creator<Province>() {
        @Override
        public Province createFromParcel(Parcel in) {
            return new Province(in);
        }

        @Override
        public Province[] newArray(int size) {
            return new Province[size];
        }
    };

    public int getErrCode() {
        return ErrCode;
    }

    public void setErrCode(int ErrCode) {
        this.ErrCode = ErrCode;
    }

    public String getErrMsg() {
        return ErrMsg;
    }

    public void setErrMsg(String ErrMsg) {
        this.ErrMsg = ErrMsg;
    }

    public List<ResponseBean> getResponse() {
        return Response;
    }

    public void setResponse(List<ResponseBean> Response) {
        this.Response = Response;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(ErrCode);
        dest.writeString(ErrMsg);
        dest.writeTypedList(Response);
    }

    public static class ResponseBean implements Parcelable{
        /**
         * id : 1770
         * title : 北京市
         * sort_id : 99
         */

        private int id;
        private String title;
        private int sort_id;

        private String sortLetters;
        private int type;

        protected ResponseBean(Parcel in) {
            id = in.readInt();
            title = in.readString();
            sort_id = in.readInt();
            sortLetters = in.readString();
            type = in.readInt();
        }

        public static final Creator<ResponseBean> CREATOR = new Creator<ResponseBean>() {
            @Override
            public ResponseBean createFromParcel(Parcel in) {
                return new ResponseBean(in);
            }

            @Override
            public ResponseBean[] newArray(int size) {
                return new ResponseBean[size];
            }
        };

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public int getSort_id() {
            return sort_id;
        }

        public void setSort_id(int sort_id) {
            this.sort_id = sort_id;
        }

        public String getSortLetters() {
            return sortLetters;
        }

        public void setSortLetters(String sortLetters) {
            this.sortLetters = sortLetters;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(id);
            dest.writeString(title);
            dest.writeInt(sort_id);
            dest.writeString(sortLetters);
            dest.writeInt(type);
        }
    }
}
